package com.qa.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.qa.dao.ArticleVoMapper;
import com.qa.service.IArticleVoService;
import com.qa.vo.ArticleVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author
 * @Date 2020/3/5 10:44
 * @Desc
 **/
@Service
public class ArticleVoServiceImpl implements IArticleVoService {

    @Autowired
    private ArticleVoMapper articleVoMapper;


    @Override
    public PageInfo<ArticleVo> getAll(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<ArticleVo> articles = articleVoMapper.getAllByStatus();
        return new PageInfo<>(articles);
    }

    @Override
    public List<ArticleVo> getAllByArticleName(String articleName) {
        return articleVoMapper.getAllByArticleName(articleName);
    }
}
